-- Just an example, supposed to be placed in /lua/custom/

local M = {}

-- make sure you maintain the structure of `core/default_config.lua` here,
-- example of changing theme:

M.ui = {
   theme = "gruvbox",
}

-- /lua/custom/chadrc.lua
local userPlugins = require "custom.plugins" -- path to table
local plugin_conf = require "custom.plugins.configs"

M.plugins = {
   default_plugin_config_replace = {
     telescope = {
       mappings = {
          n = {
            ["q"] = require('telescope.actions').close,
            ["l"] = require('telescope.actions').file_edit
          },
          i = {
            -- map actions.which_key to <C-h> (default: <C-/>)
            -- actions.which_key shows the mappings for your picker,
            -- e.g. git_{create, delete, ...}_branch for the git_branches picker
            ["<C-h>"] = require('telescope.actions').which_key,
            ["<C-j>"] = require('telescope.actions').move_selection_next,
            ["<C-k>"] = require('telescope.actions').move_selection_previous,
          }
       }
     }
   },
   options = {
      lspconfig = {
         setup_lspconf = "custom.plugins.lspconfig",
      },
   },

   override = {
      ["kyazdani42/nvim-tree.lua"] = plugin_conf.nvimtree,
      ["nvim-treesitter/nvim-treesitter"] = plugin_conf.treesitter,
      ["nvim-telescope/telescope.nvim"] = plugin_conf.telescope,
      ["NvChad/nvterm"] = plugin_conf.nvterm,
   },
   user = userPlugins,
}

M.options = {
   clipboard = "unnamed",
   tabstop = 4,
   nvChad = {
      copy_cut = true, -- copy cut text ( x key ), visual and normal mode
      copy_del = true, -- copy deleted text ( dd key ), visual and normal mode
      -- updater
      update_url = "https://api.mtr.pub/NvChad/NvChad",
      update_branch = "main",
   },
   terminal = {
      window = {
         vsplit_ratio = 0.5,
         split_ratio = 0.4,
      },
      location = {
         horizontal = "rightbelow",
         vertical = "rightbelow",
         float = {
           relative = 'editor',
           -- 迷之占比
           row = 0.1,
           col = 0.1,
           width = 0.8,
           height = 0.8,
           border = "single",
         }
      },
   },
}

-- M.mappings = {
--    -- custom = {}, -- custom user mappings
--    -- terminal related mappings
--    terminal = {
--       -- multiple mappings can be given for esc_termmode, esc_hide_termmode
--       -- show & recover hidden terminal buffers in a telescope picker
--       pick_term = "<leader>W",
-- 
--       -- spawn a single terminal and toggle it
--       -- this just works like toggleterm kinda
--       new_horizontal = "<leader>tj",
--       new_vertical = "<leader>tl",
--       new_float = "<A-i>",
-- 
--       -- spawn new terminals
--       spawn_horizontal = "<A-h>",
--       spawn_vertical = "<A-v>",
--       spawn_window = "<leader>w",
--    },
-- }
return M
